import request from '@/utils/request'

// 查询预警信息列表
export function listWarning(query) {
  return request({
    url: '/system/warning/list',
    method: 'get',
    params: query
  })
}

// 查询预警信息详细
export function getWarning(id) {
  return request({
    url: '/system/warning/' + id,
    method: 'get'
  })
}

// 新增预警信息
export function addWarning(data) {
  return request({
    url: '/system/warning',
    method: 'post',
    data: data
  })
}

// 修改预警信息
export function updateWarning(data) {
  return request({
    url: '/system/warning',
    method: 'put',
    data: data
  })
}

// 删除预警信息
export function delWarning(id) {
  return request({
    url: '/system/warning/' + id,
    method: 'delete'
  })
}

export function pullUserInfo(data) {
  return request({
    url: '/system/warning/pullUserInfo',
    method: 'post',
    data: data
  })
}

export function getWarningUserInfo(data) {
  return request({
    url: '/system/warning/getWarningUserInfo?id=' + data,
    method: 'get',
  })
}

export function callUser(data) {
  return request({
    url: '/system/warning/callUser',
    method: 'post',
    data: data
  })
}

export function getMyWarning(query) {
  return request({
    url: '/system/warning/getMyWarning',
    method: 'get',
    params: query
  })
}

// 修改预警信息
export function commitHandleResult(data) {
  return request({
    url: '/system/warning/commitHandleResult',
    method: 'put',
    data: data
  })
}

export function getStatisticsInfo(data) {
  return request({
    url: '/statistics/getStatisticsInfo',
    method: 'post',
    data: data
  })
}

export function warningAllWorker(id) {
  return request({
    url: '/system/warning/warningAllWorker?id=' + id,
    method: 'get',
  })
}